/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pipeline;

public class Pair implements Comparable<Pair>{

    private final Double first;
    private final Character second;

    public Pair (Double f, Character s) {
        this.first = f;
        this.second = s;
    }

    public Double getFirst () {
        return first;
    }

    public Character getSecond () {
        return second;
    }

    public boolean equals (Object oth) {
        if (this == oth) {
            return true;
        }
        if (oth == null || !(getClass().isInstance(oth))) {
            return false;
        }
        Pair other = getClass().cast(oth);
        return (first == null ? other.first == null : first.equals(other.first)) && (second == null ? other.second == null : second.equals(other.second));
    }

    public int compareTo (Pair o) {
        double diff =  this.getFirst()-o.getFirst();
        return (diff<0?1:(diff>0?-1:0));
    }

    @Override
    public String toString () {
        return "< "+first+" , "+second+" >";
    }


}
